import service from '@/utils/request'
import {ApiResponse,ListApiResponse} from '@/store/dataType.ts'

export interface BpmnUserGroup {
  id: number
  name: string
  userIds: string
  remark: string


}

export const API_BPMN_USER_GROUP ={

        // 创建用户组
        createUserGroup:async (data: BpmnUserGroup):Promise<ApiResponse> => {
          return await service.post('/workflow/user-group/create',data)
        },

        // 更新用户组
         updateUserGroup:async (data: BpmnUserGroup):Promise<ApiResponse> => {return await service.put('/workflow/user-group/update',data)
        },

        // 删除用户组
        deleteUserGroup:async (id: number):Promise<ApiResponse> => {
          return await service.delete(
            '/workflow/user-group/delete/' + id
          )
        },

        // 获得用户组
        getUserGroup:async (id: number):Promise<ApiResponse> => {
          return await service.get(
            '/bpm/form/' + id
          )
        },

        // 获得用户组分页
        getUserGroupPage:async (params):Promise<ListApiResponse> => {
          return await service.get(
            '/workflow/user-group/list',
            params
          )
        },

        // 获得所有启用的用户组
       getUserGroupSimpleList:async ():Promise<ApiResponse> => {
          return await service.get(
            '/workflow/user-group/user-group-all-simple-list'
          )
        },


}

